/**
 * COPYRIGHT (C) 2009. Denny Tran, Omar Jaime, David Deng, Julie Hsieh. All Rights Reserved
 * Class that represents a user in the system.  
 * @author Denny Tran, Omar Jaime, David Deng, Julie Hsieh 
 * @version 1.01 2009-05-05
 */

package data;

public class User
{
   private String userName; // username of user
   private String realName;
   private int groupID;
   private String email;
   private boolean admin; // admin status of user
   private MyCalendar userCalendar; // calendar of user's events

   /**
    * Constructs a user with the given parameters.
    * @param username The user name of the user.
    * @param name The real name of the user
    * @param groupid The group id of the user.
    * @param email The email of the user.
    */
   public User(String username, String name, int groupid, String email)
   {
      userName = username;
      realName = name;
      groupID = groupid;
      this.email = email;
   }

   /**
    * Gets the user name of this user.
    * @return The user name of this user.
    */
   public String getUserName()
   {
      return userName;
   }

   /**
    * Gets the real name of this user.
    * @return The real name of this user.
    */
   public String getRealName()
   {
      return realName;
   }

   /**
    * Sets the user name of this user.
    * @param userName The user name to set this user to.
    */
   public void setUserName(String userName)
   {
      this.userName = userName;
   }

   /**
    * Sets the real name of this user.
    * @param realName The real name to set this user to.
    */
   public void setRealName(String realName)
   {
      this.realName = realName;
   }

   /**
    * Gets the group id of this user.
    * @return The group id of this user.
    */
   public int getGroupID()
   {
      return groupID;
   }

   /**
    * Checks if this user is an admin.
    * @return True if admin, false otherwise.
    */
   public boolean isAdmin()
   {
      return admin;
   }

   /**
    * Sets the admin status of this user.
    * @param admin The admin status to set this user to.
    */
   public void setAdmin(boolean admin)
   {
      this.admin = admin;
   }

   /**
    * Gets the email of this user.
    * @return The email of this user.
    */
   public String getEmail()
   {
      return email;
   }

   /**
    * Sets the email of this user.
    * @param email The email to set for this user.
    */
   public void setEmail(String email)
   {
      this.email = email;
   }

   /**
    * Gets the user's calendar of events.
    * @return The user's calendar of events.
    */
   public MyCalendar getUserCalendar()
   {
      return userCalendar;
   }

   /**
    * Sets the user's calendar of events.
    * @param userCalendar The calendar to set for this user.
    */
   public void setUserCalendar(MyCalendar userCalendar)
   {
      this.userCalendar = userCalendar;
   }
   
   /**
    * Displays information about this user.
    */
   public String toString()
   {
      return "User: " + userName + ", Name: " + realName + ", " + email;
   }

}
